﻿#region

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BuXiaChu.OrderDishes.Model;
using BuXiaChu.OrderDishes.DAL;

#endregion

namespace BuXiaChu.OrderDishes.BLL
{
    public class UserInfoManager
    {
        /// <summary>
        /// Insert Or Update
        /// </summary>
        public static bool Save(UserInfoModel obj)
        {
            if (obj.UserId <= 0)
            {
                System.Threading.Thread.Sleep(2);
                obj.LoginName = "AM" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
                obj.EMail = obj.LoginName + "@buxiachu.com";
            }
            return UserInfoDAL.Save(obj);
        }

        public static UserInfoModel GetUserInfoById(int userId)
        {
            return UserInfoDAL.GetUserInfoById(userId);
        }

        public static List<UserInfoModel> Search(string sqlWhere, int pageIndex, int pageSize, out int pageCount)
        {
            return UserInfoDAL.Search(sqlWhere, pageIndex, pageSize, out pageCount);
        }
    }
}
